package com.codedef.cidaren.entity;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.codedef.cidaren.valid.AddGroup;
import com.codedef.cidaren.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 用户系统
 * 
 * @author sun
 * @email 1138794994@qq.com
 * @date 2020-08-22 01:03:59
 */
@Data
@TableName("cdr_user")
public class UserEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * $column.comments
	 */
	@NotNull(message = "修改必须指定id", groups = {UpdateGroup.class})
	@Null(message = "新增不能指定id", groups = {AddGroup.class})
	@TableId
	private Integer id;

	/**
	 * $column.comments
	 */
	@NotBlank(message = "用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Size(min = 3, max = 100, message = "用户名长度不合法", groups = {AddGroup.class})
	private String username;

	/**
	 * $column.comments
	 */
	@NotBlank(message = "密码名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Size(min = 6, max = 100, message = "密码长度不合法", groups = {AddGroup.class})
	private String password;

	/**
	 * $column.comments
	 */
	private String salt;

	/**
	 * $column.comments
	 */
	private Integer level;

	/**
	 * $column.comments
	 */
	private Integer tax;

	/**
	 * $column.comments
	 */
	private Integer status;

	/**
	 * $column.comments
	 */
	private Date lastLoginTime;

	/**
	 * $column.comments
	 */
	private String lastLoginIp;

	/**
	 * $column.comments
	 */
	private String lastWechatToken;

	/**
	 * $column.comments
	 */
	private Integer lastWechatStatus;

	/**
	 * $column.comments
	 */
	@Email(message = "邮箱格式不合法", groups = {AddGroup.class, UpdateGroup.class})
	private String email;

	/**
	 * $column.comments
	 */
	private String tel;

}
